package consys.social.core.service;

import consys.social.core.NotAuthorizedException;
import consys.social.core.bo.Entity;
import consys.social.core.bo.Wall;
import consys.social.core.bo.WallPost;
import java.io.IOException;
import java.util.Date;

/**
 *
 * @author petan
 */
public interface WallService {
    void postPost(WallPost post) throws IOException, NotAuthorizedException;
    void deletePost(WallPost post) throws IOException, NotAuthorizedException;

    /**
     * loads wall for entity
     * from is integer because we load it from list that's why index is most suitable
     * so in application we have to remember how many posts we currently know
     * source and target has to equal because only I can view my wall. Nobody else (Security)
     *
     * @param entity Entity whose wall is wanted to be vieved
     * @param count
     * @param from
     * @return Wall for entity having count posts
     */
    Wall loadEntityWall(Entity target, int count, int from) throws IOException, NotAuthorizedException;
    Wall loadEntityWallNewest(Entity target, int count) throws IOException, NotAuthorizedException;

    /**
     * loads profile wall for entity
     * from is date because we load it from HBase and we need to set up scanner
     * so in app we have to remember oldest post we showed and pass it to this method
     * source and target has to equal or source has to follow target
     *
     * @param entity Entity whose profile is wanted to be vieved
     * @param count
     * @param from
     * @return
     */
    Wall loadEntityProfileWall(Entity target, int count, Date from) throws IOException, NotAuthorizedException;
    Wall loadEntityProfileWallNewest(Entity target, int count) throws IOException, NotAuthorizedException;

    Wall loadWallContainingTag(String string, int count, Date from) throws IOException;
}